/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.DataAccess
*        文件名:             BaseWorkFlowCurrentDao.cs
*        创建系统时间:       2012/11/2 19:07:00
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.DataAccess
{
    using System.Data;
    using ECP.DataAccess.Utilities;
    using ECP.Model;
    using ECP.Utilities;

    public class BaseWorkFlowCurrentDao : BaseDao, IBaseDao
    {
        public BaseWorkFlowCurrentDao()
        {
            base.CurrentTableName = BaseWorkFlowCurrentTable.TableName;
        }

        public BaseWorkFlowCurrentDao(IDbHelper dbHelper, BaseUserInfo userInfo)
        {
            base.DbHelper = dbHelper;
            base.UserInfo = userInfo;
        }

        public string AddEntity(BaseWorkFlowCurrentEntity workFlowCurrentEntity)
        {
            string sequence = BaseSequenceDao.Instance.GetSequence(base.DbHelper, BaseWorkFlowCurrentTable.TableName);
            SQLBuilder builder = new SQLBuilder(base.DbHelper);
            builder.BeginInsert(BaseWorkFlowCurrentTable.TableName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldID, sequence);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldStepID, workFlowCurrentEntity.StepID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldFlowID, workFlowCurrentEntity.FlowID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditUserID, workFlowCurrentEntity.AuditUserID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditUserFullName, workFlowCurrentEntity.AuditUserFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditDepartmentID, workFlowCurrentEntity.AuditDepartmentID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditDepartmentFullName, workFlowCurrentEntity.AuditDepartmentFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditIdea, workFlowCurrentEntity.AuditIdea);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditState, workFlowCurrentEntity.AuditState);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldCategoryID, workFlowCurrentEntity.CategoryID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldCategoryFullName, workFlowCurrentEntity.CategoryFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldObjectID, workFlowCurrentEntity.ObjectID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldObjectFullName, workFlowCurrentEntity.ObjectFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldSortCode, sequence);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldEnabled, workFlowCurrentEntity.Enabled);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldDescription, workFlowCurrentEntity.Description);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldCreateUserID, base.UserInfo.ID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldCreateUserFullName, base.UserInfo.Realname);
            builder.SetDBNow(BaseWorkFlowCurrentTable.FieldCreateDate);
            return ((builder.EndInsert() > 0) ? sequence : string.Empty);
        }

        private string AddHistory(string id)
        {
            BaseWorkFlowCurrentEntity entity = this.GetEntity(id);
            BaseWorkFlowHistoryEntity workFlowHistoryEntity = new BaseWorkFlowHistoryEntity
            {
                StepID = entity.StepID,
                FlowID = entity.ID,
                AuditUserID = entity.AuditUserID,
                AuditUserFullName = entity.AuditUserFullName,
                AuditDepartmentID = entity.AuditDepartmentID,
                AuditDepartmentFullName = entity.AuditDepartmentFullName,
                AuditState = entity.AuditState,
                AuditIdea = entity.AuditIdea,
                CreateUserID = base.UserInfo.ID,
                CreateUserFullName = base.UserInfo.Realname,
                Enabled = true
            };
            BaseWorkFlowHistoryDao dao = new BaseWorkFlowHistoryDao(base.DbHelper, base.UserInfo);
            return dao.AddEntity(workFlowHistoryEntity);
        }

        public string AddSubmit(string categoryID, string categoryFullName, string objectID, string objectFullName, string sendToStaffID)
        {
            string id = DbLogic.FindID(base.DbHelper, BaseWorkFlowCurrentTable.TableName, BaseWorkFlowCurrentTable.FieldCategoryID, categoryID, BaseWorkFlowCurrentTable.FieldObjectID, objectID);
            if (id.Length > 0)
            {
                this.UpdataSubmit(categoryID, categoryFullName, objectID, objectFullName, sendToStaffID, id);
                return id;
            }
            id = this.StepAddSubmit(categoryID, categoryFullName, objectID, objectFullName, sendToStaffID);
            base.ReturnStatusCode = StatusCode.OK.ToString();
            base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
            this.AddHistory(id);
            return id;
        }

        public int AuditCommit(string id, string auditIdea)
        {
            int num = 0;
            num = this.StepAuditCommit(id, auditIdea);
            if (num == 1)
            {
                this.AddHistory(id);
            }
            else
            {
                base.ReturnStatusCode = StatusCode.ErrorDeleted.ToString();
            }
            base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
            return num;
        }

        public int AuditPass(string id, string auditIdea)
        {
            int num = 0;
            num = this.StepAuditPass(id, auditIdea);
            if (num == 1)
            {
                this.AddHistory(id);
            }
            else
            {
                base.ReturnStatusCode = StatusCode.ErrorDeleted.ToString();
            }
            base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
            return num;
        }

        public int AuditQuash(string id, string auditIdea)
        {
            int num = 0;
            this.Get(id);
            if (base.ModifyUserID == base.UserInfo.ID)
            {
                num = this.StepAuditQuash(id, auditIdea);
                if (num == 1)
                {
                    this.AddHistory(id);
                }
                else
                {
                    base.ReturnStatusCode = StatusCode.ErrorDeleted.ToString();
                }
            }
            else
            {
                base.ReturnStatusCode = AuditStatus.QuashFail.ToString();
            }
            base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
            return num;
        }

        public int AuditReject(string id, string auditIdea, string sendToStaffID)
        {
            int num = 0;
            num = this.StepAuditReject(id, auditIdea, sendToStaffID);
            if (num == 1)
            {
                base.ReturnStatusCode = AuditStatus.AuditReject.ToString();
                this.AddHistory(id);
            }
            else
            {
                base.ReturnStatusCode = StatusCode.ErrorDeleted.ToString();
            }
            base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
            return num;
        }

        public DataSet GetAllWaitForAuditList(DataSet dataSet)
        {
            string sqlQuery = " SELECT *    FROM " + BaseWorkFlowCurrentTable.TableName + "  WHERE (" + BaseWorkFlowCurrentTable.FieldEnabled + " = ?)     AND (" + BaseWorkFlowCurrentTable.FieldAuditState + "= ? OR " + BaseWorkFlowCurrentTable.FieldAuditState + "= ? OR " + BaseWorkFlowCurrentTable.FieldAuditState + "= ?)";
            string[] targetFileds = new string[4];
            object[] targetValues = new object[4];
            targetFileds[0] = BaseWorkFlowCurrentTable.FieldEnabled;
            targetValues[0] = 1;
            targetFileds[1] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[1] = AuditStatus.WaitForAudit.ToString();
            targetFileds[2] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[2] = AuditStatus.StartAudit.ToString();
            targetFileds[3] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[3] = AuditStatus.AuditReject.ToString();
            base.DbHelper.Fill(dataSet, sqlQuery, BaseWorkFlowCurrentTable.TableName, base.DbHelper.MakeParameters(targetFileds, targetValues));
            return dataSet;
        }

        public BaseWorkFlowCurrentEntity GetEntity(string id)
        {
            return new BaseWorkFlowCurrentEntity(this.Get(id));
        }

        public DataSet GetForAuditList(DataSet dataSet)
        {
            string sqlQuery = " SELECT *    FROM " + BaseWorkFlowCurrentTable.TableName + "  WHERE (" + BaseWorkFlowCurrentTable.FieldEnabled + " = ?)     AND (((" + BaseWorkFlowCurrentTable.FieldAuditUserID + "= ?) AND (" + BaseWorkFlowCurrentTable.FieldAuditState + "= ? OR " + BaseWorkFlowCurrentTable.FieldAuditState + "= ?))      OR  ((" + BaseWorkFlowCurrentTable.FieldCreateUserID + "= ?) AND (" + BaseWorkFlowCurrentTable.FieldAuditState + "= ? )))      OR " + BaseWorkFlowCurrentTable.FieldID + " IN (SELECT DISTINCT " + BaseWorkFlowCurrentTable.FieldFlowID + " FROM " + BaseWorkFlowHistoryTable.TableName + "               WHERE " + BaseWorkFlowHistoryTable.FieldAuditUserID + " = ? OR " + BaseWorkFlowHistoryTable.FieldCreateUserID + " = ?) ";
            string[] targetFileds = new string[6];
            object[] targetValues = new object[6];
            targetFileds[0] = BaseWorkFlowCurrentTable.FieldEnabled;
            targetValues[0] = 1;
            targetFileds[1] = BaseWorkFlowCurrentTable.FieldAuditUserID;
            targetValues[1] = base.UserInfo.ID;
            targetFileds[2] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[2] = AuditStatus.WaitForAudit.ToString();
            targetFileds[3] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[3] = AuditStatus.StartAudit.ToString();
            targetFileds[4] = BaseWorkFlowCurrentTable.FieldCreateUserID;
            targetValues[4] = base.UserInfo.ID;
            targetFileds[5] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[5] = AuditStatus.AuditReject.ToString();
            targetFileds[6] = BaseWorkFlowCurrentTable.FieldCreateUserID;
            targetValues[6] = base.UserInfo.ID;
            targetFileds[7] = BaseWorkFlowCurrentTable.FieldCreateUserID;
            targetValues[7] = base.UserInfo.ID;
            base.DbHelper.Fill(dataSet, sqlQuery, BaseWorkFlowCurrentTable.TableName, base.DbHelper.MakeParameters(targetFileds, targetValues));
            return dataSet;
        }

        public string GetIDByCategoryObject(string categoryID, string objectID)
        {
            return DbLogic.FindID(base.DbHelper, BaseWorkFlowCurrentTable.TableName, BaseWorkFlowCurrentTable.FieldCategoryID, categoryID, BaseWorkFlowCurrentTable.FieldObjectID, objectID);
        }

        public DataSet GetWaitForAuditList(DataSet dataSet)
        {
            string sqlQuery = " SELECT *    FROM " + BaseWorkFlowCurrentTable.TableName + "  WHERE (" + BaseWorkFlowCurrentTable.FieldEnabled + " = ?)     AND (((" + BaseWorkFlowCurrentTable.FieldAuditUserID + "= ?) AND (" + BaseWorkFlowCurrentTable.FieldAuditState + "= ? OR " + BaseWorkFlowCurrentTable.FieldAuditState + "= ?))      OR  ((" + BaseWorkFlowCurrentTable.FieldCreateUserID + "= ?) AND (" + BaseWorkFlowCurrentTable.FieldAuditState + "= ? ))) ";
            string[] targetFileds = new string[6];
            object[] targetValues = new object[6];
            targetFileds[0] = BaseWorkFlowCurrentTable.FieldEnabled;
            targetValues[0] = 1;
            targetFileds[1] = BaseWorkFlowCurrentTable.FieldAuditUserID;
            targetValues[1] = base.UserInfo.ID;
            targetFileds[2] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[2] = AuditStatus.WaitForAudit.ToString();
            targetFileds[3] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[3] = AuditStatus.StartAudit.ToString();
            targetFileds[4] = BaseWorkFlowCurrentTable.FieldCreateUserID;
            targetValues[4] = base.UserInfo.ID;
            targetFileds[5] = BaseWorkFlowCurrentTable.FieldAuditState;
            targetValues[5] = AuditStatus.AuditReject.ToString();
            base.DbHelper.Fill(dataSet, sqlQuery, BaseWorkFlowCurrentTable.TableName, base.DbHelper.MakeParameters(targetFileds, targetValues));
            return dataSet;
        }

        public int SendTo(string id, string sendToStaffID)
        {
            int num = 0;
            num = this.StepSendTo(id, sendToStaffID);
            if (num == 1)
            {
                base.ReturnStatusCode = AuditStatus.SubmitOK.ToString();
                this.AddHistory(id);
            }
            else
            {
                base.ReturnStatusCode = StatusCode.ErrorDeleted.ToString();
            }
            base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
            return num;
        }

        public string StartAudit(string flowID, string categoryID, string categoryFullName, string objectID, string objectFullName)
        {
            string id = string.Empty;
            id = DbLogic.FindID(base.DbHelper, BaseWorkFlowCurrentTable.TableName, BaseWorkFlowCurrentTable.FieldCategoryID, categoryID, BaseWorkFlowCurrentTable.FieldObjectID, objectID);
            if (id.Length > 0)
            {
                base.ReturnStatusCode = StatusCode.OK.ToString();
                base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
                return id;
            }
            id = this.StepStartAudit(flowID, categoryID, categoryFullName, objectID, objectFullName);
            base.ReturnStatusCode = StatusCode.OK.ToString();
            base.ReturnStatusMessage = base.GetStateMessage(base.ReturnStatusCode);
            this.AddHistory(id);
            return id;
        }

        private string StepAddSubmit(string categoryID, string categoryFullName, string objectID, string objectFullName, string sendToStaffID)
        {
            BaseStaffEntity entity = new BaseStaffEntity();
            new BaseStaffDao(base.DbHelper, base.UserInfo).Get(sendToStaffID, entity);
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = new BaseWorkFlowCurrentEntity
            {
                StepID = "1",
                CategoryID = categoryID,
                CategoryFullName = categoryFullName,
                ObjectID = objectID,
                ObjectFullName = objectFullName,
                AuditUserID = sendToStaffID,
                AuditUserFullName = entity.Realname,
                AuditDepartmentID = entity.DepartmentID,
                Enabled = 1,
                AuditState = AuditStatus.StartAudit.ToString()
            };
            return this.AddEntity(workFlowCurrentEntity);
        }

        private int StepAuditCommit(string id, string auditIdea)
        {
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = this.GetEntity(id);
            workFlowCurrentEntity.Enabled = 0;
            workFlowCurrentEntity.AuditIdea = auditIdea;
            workFlowCurrentEntity.AuditUserID = base.UserInfo.ID;
            workFlowCurrentEntity.AuditUserFullName = base.UserInfo.Realname;
            workFlowCurrentEntity.AuditDepartmentID = base.UserInfo.DepartmentID;
            workFlowCurrentEntity.AuditDepartmentFullName = base.UserInfo.DepartmentFullName;
            workFlowCurrentEntity.AuditState = AuditStatus.AuditComplete.ToString();
            return this.UpdateEntity(workFlowCurrentEntity);
        }

        private int StepAuditPass(string id, string auditIdea)
        {
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = this.GetEntity(id);
            workFlowCurrentEntity.AuditIdea = auditIdea;
            workFlowCurrentEntity.AuditUserID = base.UserInfo.ID;
            workFlowCurrentEntity.AuditUserFullName = base.UserInfo.Realname;
            workFlowCurrentEntity.AuditDepartmentID = base.UserInfo.DepartmentID;
            workFlowCurrentEntity.AuditDepartmentFullName = base.UserInfo.DepartmentFullName;
            workFlowCurrentEntity.AuditState = AuditStatus.AuditPass.ToString();
            return this.UpdateEntity(workFlowCurrentEntity);
        }

        private int StepAuditQuash(string id, string auditIdea)
        {
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = this.GetEntity(id);
            workFlowCurrentEntity.AuditIdea = auditIdea;
            workFlowCurrentEntity.AuditUserID = base.UserInfo.ID;
            workFlowCurrentEntity.AuditUserFullName = base.UserInfo.Realname;
            workFlowCurrentEntity.AuditDepartmentID = base.UserInfo.DepartmentID;
            workFlowCurrentEntity.AuditDepartmentFullName = base.UserInfo.DepartmentFullName;
            workFlowCurrentEntity.AuditState = AuditStatus.WaitForAudit.ToString();
            return this.UpdateEntity(workFlowCurrentEntity);
        }

        private int StepAuditReject(string id, string auditIdea, string sendToStaffID)
        {
            BaseStaffDao dao = new BaseStaffDao(base.DbHelper, base.UserInfo);
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = this.GetEntity(id);
            workFlowCurrentEntity.Enabled = 1;
            workFlowCurrentEntity.AuditIdea = auditIdea;
            BaseStaffEntity entity2 = new BaseStaffEntity();
            if (!string.IsNullOrEmpty(sendToStaffID))
            {
                dao.Get(sendToStaffID, entity2);
                workFlowCurrentEntity.AuditUserID = sendToStaffID;
                workFlowCurrentEntity.AuditUserFullName = entity2.Realname;
                workFlowCurrentEntity.AuditDepartmentID = entity2.DepartmentID;
            }
            else
            {
                workFlowCurrentEntity.AuditUserID = base.UserInfo.ID;
                workFlowCurrentEntity.AuditUserFullName = base.UserInfo.Realname;
                dao.Get(base.CreateUserID, entity2);
                workFlowCurrentEntity.AuditDepartmentID = entity2.DepartmentID;
            }
            workFlowCurrentEntity.AuditState = AuditStatus.AuditReject.ToString();
            return this.UpdateEntity(workFlowCurrentEntity);
        }

        private int StepSendTo(string id, string sendToStaffID)
        {
            BaseStaffEntity entity = new BaseStaffEntity();
            new BaseStaffDao(base.DbHelper, base.UserInfo).Get(sendToStaffID, entity);
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = this.GetEntity(id);
            workFlowCurrentEntity.AuditIdea = string.Empty;
            workFlowCurrentEntity.AuditState = AuditStatus.WaitForAudit.ToString();
            workFlowCurrentEntity.AuditUserID = sendToStaffID;
            workFlowCurrentEntity.AuditUserFullName = entity.Realname;
            workFlowCurrentEntity.AuditDepartmentID = entity.DepartmentID;
            workFlowCurrentEntity.AuditState = AuditStatus.WaitForAudit.ToString();
            return this.UpdateEntity(workFlowCurrentEntity);
        }

        private string StepStartAudit(string flowID, string categoryID, string categoryFullName, string objectID, string objectFullName)
        {
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = new BaseWorkFlowCurrentEntity
            {
                StepID = "1",
                FlowID = flowID,
                CategoryID = categoryID,
                CategoryFullName = categoryFullName,
                ObjectID = objectID,
                ObjectFullName = objectFullName,
                AuditUserID = base.UserInfo.ID,
                AuditUserFullName = base.UserInfo.Realname,
                AuditDepartmentID = base.UserInfo.DepartmentID,
                AuditDepartmentFullName = base.UserInfo.DepartmentFullName,
                Enabled = 1,
                AuditState = AuditStatus.StartAudit.ToString()
            };
            return this.AddEntity(workFlowCurrentEntity);
        }

        private int StepUpdataSubmit(string categoryID, string categoryFullName, string objectID, string objectFullName, string sendToStaffID, string id)
        {
            BaseStaffEntity entity = new BaseStaffEntity();
            new BaseStaffDao(base.DbHelper, base.UserInfo).Get(sendToStaffID, entity);
            BaseWorkFlowCurrentEntity workFlowCurrentEntity = this.GetEntity(id);
            workFlowCurrentEntity.CategoryID = categoryID;
            workFlowCurrentEntity.CategoryFullName = categoryFullName;
            workFlowCurrentEntity.ObjectID = objectID;
            workFlowCurrentEntity.ObjectFullName = objectFullName;
            workFlowCurrentEntity.AuditUserID = sendToStaffID;
            workFlowCurrentEntity.AuditUserFullName = entity.Realname;
            workFlowCurrentEntity.AuditDepartmentID = entity.DepartmentID;
            workFlowCurrentEntity.Enabled = 1;
            workFlowCurrentEntity.AuditState = AuditStatus.StartAudit.ToString();
            return this.UpdateEntity(workFlowCurrentEntity);
        }

        public int UpdataSubmit(string categoryID, string categoryFullName, string objectID, string objectFullName, string sendToStaffID, string id)
        {
            int num = 0;
            num = this.StepUpdataSubmit(categoryID, categoryFullName, objectID, objectFullName, sendToStaffID, id);
            if (num == 1)
            {
                base.ReturnStatusCode = AuditStatus.StartAudit.ToString();
                this.AddHistory(id);
                return num;
            }
            base.ReturnStatusCode = StatusCode.ErrorDeleted.ToString();
            return num;
        }

        public int UpdateEntity(BaseWorkFlowCurrentEntity workFlowCurrentEntity)
        {
            SQLBuilder builder = new SQLBuilder(base.DbHelper);
            builder.BeginUpdate(BaseWorkFlowCurrentTable.TableName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldStepID, workFlowCurrentEntity.StepID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldFlowID, workFlowCurrentEntity.FlowID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditUserID, workFlowCurrentEntity.AuditUserID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditUserFullName, workFlowCurrentEntity.AuditUserFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditDepartmentID, workFlowCurrentEntity.AuditDepartmentID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditDepartmentFullName, workFlowCurrentEntity.AuditDepartmentFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditIdea, workFlowCurrentEntity.AuditIdea);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldAuditState, workFlowCurrentEntity.AuditState);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldCategoryID, workFlowCurrentEntity.CategoryID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldCategoryFullName, workFlowCurrentEntity.CategoryFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldObjectID, workFlowCurrentEntity.ObjectID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldObjectFullName, workFlowCurrentEntity.ObjectFullName);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldEnabled, workFlowCurrentEntity.Enabled);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldDescription, workFlowCurrentEntity.Description);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldModifyUserID, base.UserInfo.ID);
            builder.SetValue(BaseWorkFlowCurrentTable.FieldModifyUserFullName, base.UserInfo.Realname);
            builder.SetDBNow(BaseWorkFlowCurrentTable.FieldModifyDate);
            builder.SetWhere(BaseWorkFlowCurrentTable.FieldID, workFlowCurrentEntity.ID);
            return builder.EndUpdate();
        }
    }
}